﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace TB_CS.Class
{
    public class SysInfo
    {
        public static WS_Seller.Seller_Manage WSSELLER = new WS_Seller.Seller_Manage();
        public static WS_S_User.Seller_User WSSUSER = new WS_S_User.Seller_User();
        public static WS_HongBao.HongBao_Logic WSHB = new WS_HongBao.HongBao_Logic();
        public static WS_TB_Top.TB_Top WS_TOP = new WS_TB_Top.TB_Top();
        public static WS_Event.Event WSEE = new WS_Event.Event();
        public static WS_Rate.Rate_Manage WSRATE = new WS_Rate.Rate_Manage();
        public static WS_DingTalk.DingTalk WSDK = new WS_DingTalk.DingTalk();
        public static WS_PPush.Price_Push WSPP = new WS_PPush.Price_Push();
        public static WS_RDS.RDS_Server WSRDS = new WS_RDS.RDS_Server();

        private static XmlDocument xml = new XmlDocument();
        public static XmlNode HB_List;
        public static string WX_User = XML_VALUE("WX_User");
        public static string GET_Seller_Nick()
        {
            return XML_VALUE("Seller_Nick");
        }

        public static string Get_UserName()
        {
            return XML_VALUE("UserName");
        }

        public static string Get_UserPWD()
        {
            return XML_VALUE("UserPWD");
        }

        public static string Get_Return_Rate()
        {
            return XML_VALUE("RR");
        }

        public static string Get_Server()
        {
            return XML_VALUE("Server");
        }

        public static string Get_Version()
        {
            return XML_VALUE("Version");
        }

        public static string Get_Rate_Show()
        {
            return XML_VALUE("Rate_Show");
        }

        private static string XML_VALUE(string KEY)
        {
            xml.Load(Application.StartupPath + @"\CS_Config.xml");
            HB_List = xml.SelectSingleNode("//CS");
            return HB_List[KEY].InnerText.ToString();
            
        }
        public static void INSERT_VALUE(string KEY,string Value)
        {
            xml.Load(Application.StartupPath + @"\CS_Config.xml");
            HB_List = xml.SelectSingleNode("//CS");
            HB_List[KEY].InnerText = Value.Trim().ToString();
            xml.Save(Application.StartupPath + @"\CS_Config.xml");
        }

        public static string S_User_Name, S_U_Password;
        public static string INFO_Seller_Nick, INFO_Seller_ID, Info_Seller_PWD;
    }
}
